<template>
	<block>
		<view id="navbar">
			<u-navbar title-size="32" title-color="#000" bgColor="unset" height="44" @leftClick="leftClick">
				<view class="u-nav-slot" slot="left">
					<u-icon name="arrow-left" size="19" v-if="historyLength > 1"></u-icon>
					<u-icon name="home" size="20" v-else></u-icon>
				</view>
			</u-navbar>
		</view>
		<div class="bg">
			<div v-if="questionnaire" class="header">
				<div class="title">
					<div>很遗憾</div>
					<div>您不满足问卷调研人群</div>
				</div>
				<div class="desc">
					该问卷仅限青丝几何{{questionnaire.NAME}}的会员参与调研，感谢您的关注~
				</div>
			</div>

			<div class="btn-group">
				<div class="btn" @click="leftClick">
					<text>返回首页</text>
				</div>
				<!-- <div class="plain-btn" @click="lookMore">查看更多活动</div> -->
			</div>
		</div>



	</block>
</template>

<script>
	import {
		wx_questionnaire_list
	} from "@/api";



	export default {
		data() {
			return {
				questionnaire: null,
				historyLength: 0
			}
		},

		methods: {
			lookMore() {
				wx.switchTab({
					url: '/pages/home'
				})
			},
			leftClick() {
				if (this.historyLength > 1) {
					wx.navigateBack({
						delta: 1
					});
					return
				}
				wx.switchTab({
					url: '/pages/index/index'
				})

			},

			async wx_questionnaire_list() {
				const res = await wx_questionnaire_list({
					question_id: Number(this.question_id)
				})
				this.questionnaire = res.questionnaires[0]
			},

		},
		onLoad(options) {
			options.scene ? this.question_id = options.scene : this.question_id = options.question_id
			this.wx_questionnaire_list()
			const pages = getCurrentPages();
			this.historyLength = pages.length
		}
	}
</script>

<style lang="scss" scoped>
	.btn-group {
		// position: absolute;
		// width: 100%;
		// top: 432rpx;
	}

	.bg {
		position: absolute;
		width: 100%;
		height: 640rpx;
		background: url(https://crm.fwh1988.cn/newimg/wenquan/wenjuanbg3.png) no-repeat center;
	}

	.header {
		margin-top: 208rpx;
	}

	.title {
		font-weight: 500;
		font-size: 36rpx;
		color: #B88E53;
		line-height: 50rpx;
		text-align: center;
		font-style: normal;
	}

	.desc {
		text-align: center;
		font-weight: 400;
		font-size: 28rpx;
		color: #646566;
		line-height: 40rpx;
		font-style: normal;
		padding: 24rpx 48rpx 0;
	}

	.btn {
		background: #F1E4C5;
		font-weight: 500;
		font-size: 32rpx;
		color: #82511D;
		line-height: 44rpx;
		letter-spacing: 1px;
		text-align: center;
		font-style: normal;
		display: flex;
		justify-content: center;
		align-items: center;
		border-radius: 48rpx;
		margin: 64rpx 24rpx 20rpx;
		height: 96rpx;
	}

	.plain-btn {
		background: #F7F8FA;
		font-weight: 500;
		font-size: 32rpx;
		color: #C6A36C;
		line-height: 44rpx;
		letter-spacing: 1px;
		text-align: center;
		font-style: normal;
		display: flex;
		justify-content: center;
		align-items: center;
		border-radius: 48rpx;
		margin: 0 24rpx;
		height: 96rpx;
		border: 2rpx solid #C6A36C;
	}

	.submit {
		background: url(https://crm.fwh1988.cn/newimg/wenquan/wenjuanbg3.png);
		background-repeat: no-repeat;
		min-height: 1000rpx;
		background-size: contain;


		&-evalute {
			font-weight: 500;
			font-size: 36rpx;
			color: #B88E53;
			line-height: 50rpx;
			font-style: normal;
			display: flex;
			justify-content: center;
			align-items: center;
		}

		&-thank {
			font-weight: 400;
			font-size: 28rpx;
			color: #646566;
			line-height: 42rpx;
			text-align: center;
			font-style: normal;
			margin-top: 64rpx;
		}

		&-point {
			font-weight: 400;
			font-size: 28rpx;
			color: #646566;
			line-height: 42rpx;
			text-align: center;
			font-style: normal;
			margin-top: 16rpx;
		}

		&-back__home {
			margin: 116rpx 48rpx 32rpx;
			background: #F1E4C5;
			border-radius: 48rpx;
			height: 96rpx;
			font-weight: 500;
			font-size: 32rpx;
			color: #82511D;
			line-height: 44rpx;
			letter-spacing: 1px;
			text-align: center;
			font-style: normal;
			display: flex;
			justify-content: center;
			align-items: center;
		}

		&-look__more {
			margin: 0 48rpx;
			height: 96rpx;
			border-radius: 48rpx;
			border: 2rpx solid #C6A36C;
			display: flex;
			justify-content: center;
			align-items: center;
			font-weight: 500;
			font-size: 32rpx;
			color: #C6A36C;
			line-height: 44rpx;
			text-align: center;
			font-style: normal;
		}
	}

	.noEvent {
		pointer-events: none;
	}
</style>